#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSqlDatabase>
#include <QtSql>
#include <QSqlQuery>
#include <QSqlTableModel>
#include <QModelIndex>
#include "documentdialog.h"
#include "document.h"
#include "database.h"


namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    Database* db;



private slots:
    void show_clients();
    void show_documents();
    void table_clicked(const QModelIndex & index);

private:
    Ui::MainWindow *ui;
    QSqlRelationalTableModel * model_client;
    QSqlRelationalTableModel * model_document;
    DocumentDialog* dialog;
    Document* document;


};

#endif // MAINWINDOW_H
